<template>
  <el-dialog
    title="班级详情"
    :visible.sync="dialogVisible"
    :close-on-click-modal="false"
  >
    <div class="classroom">
      <el-descriptions
        class="margin-top"
        :title="row.classAlias"
        :column="1"
        size="medium"
        border
      >
        <el-descriptions-item>
          <template slot="label"> 主讲教师 </template>
          {{ row.teacherName }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label"> 建班日期 </template>
          {{ row.createTime }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label"> 注册学生 </template>
          {{ row.studentNum || 0 }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label"> 线下教室 </template>
          {{ row.classAddr }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label"> 总课时 </template>
          {{ row.totalCourseHours }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label"> 开课日期 </template>
          {{ row.courseStartDate }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label"> 开课周 </template>
          {{ row.courseStartWeeks }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label"> 周课节次 </template>
          {{ row.courseWeeksSection }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label"> 计划结课周 </template>
          {{ row.planEndWeeks }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label"> 是否结课 </template>
          <span v-show="row.isFinish == 1">是</span>
          <span v-show="row.isFinish != 1">否</span>
        </el-descriptions-item>
      </el-descriptions>
    </div>
  </el-dialog>
</template>
<script>
export default {
  data() {
    return {
      dialogVisible: false,
      row: {},
    }
  },

  mounted() {
    this.$bus.$on('showDialogClassroom', this.init)
  },
  beforeDestroy() {
    this.$bus.$off('showDialogClassroom')
  },
  methods: {
    //显示弹窗
    init(row) {
      this.row = row
      this.dialogVisible = true
    },
  },
}
</script>
<style scoped lang="scss">
</style>